<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="layout.xhtml">
        <ui:define name="body">

            <h:form id="userForm" enctype="multipart/form-data">
                <h1 class="title">
                    <a href="#" class="back" onclick="history.go(-1)"/>
                    Usuário
                </h1>
                <p:growl id="messages" showDetail="true" autoUpdate="true"  /> 
                <div class="row">
                    <div class="twelve columns"> 

                        <p:button value="Editar" icon="ui-icon-pencil" href="edituser.xhtml?userEdit=#{managerSearchUser.showUser.id}" 
                                  style="position: relative; float: right; margin-top: -20px" styleClass="ui-priority-primary"  />
                        <div class="clear"/>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Dados Gerais</h4></legend>

                            <p:panel id="userPanel" style="background: none; border: none;" 
                                     >
                                <h:panelGrid columns="2" style="padding-left: 25px;">
                                    <p:outputLabel value="Nome: "/>
                                    <h:outputText  value="#{managerSearchUser.showUser.name}" />

                                    <p:outputLabel value="Login: " />
                                    <h:outputText  value="#{managerSearchUser.showUser.login}" />
                                </h:panelGrid>

                            </p:panel>

                        </fieldset>
                        <fieldset>
                            <legend> <h4 style="margin:0 0 10px 0">Acesso</h4></legend>
                            <p:panel id="acessPanel" style="background: none; border: none;" 
                                     styleClass="container_24 clearfix ">

                                <p:dataTable id="tableAcesso" var="g" value="#{managerSearchUser.showGroups}" 
                                             styleClass="grid_24"
                                             rowIndexVar="rowid"
                                             rowKey="#{u.id}"
                                             rows="5" paginator="true"  
                                             paginatorPosition="bottom"
                                             emptyMessage="Nenhum registro">  
                                    <f:facet name="header">
                                        Nível de Acesso
                                    </f:facet>
                                    <p:column headerText="Grupo" width="600">  
                                        <h:outputText value="#{g.name}"/>
                                    </p:column>  

                                </p:dataTable> 

                            </p:panel>
                        </fieldset>

                        <br/>
                        <div class="buttonAction">

                            <p:button href="searchuser.xhtml" value="Voltar"  icon="ui-icon-arrowreturnthick-1-w" />
                        </div >
                    </div>
                </div>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
